package com.lingnan.feign;

import com.lingnan.entity.po.CompanyHr;
import com.lingnan.entity.po.JobSeeker;
import com.lingnan.entity.po.UserAccount;
import com.lingnan.entity.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "user-service",path = "/user")
public interface UserFeignClient {
    /**
     * 根据用户账户ID查询求职者信息
     */
    @GetMapping("/jobSeeker/{userId}")
    public Result<JobSeeker> getJobSeekerByUserId(@PathVariable("userId") Long userId);

    /**
     * 根据用户账户ID查询HR信息
     */
    @GetMapping("/hr/{userId}")
    public CompanyHr getHrByUserId(@PathVariable("userId") Long userId);

    /**
     * 根据用户ID获取用户账户信息
     */
    @GetMapping("/account/{userId}")
    UserAccount getUserAccountById(@PathVariable("userId") Long userId);

    // 新增批量查询接口（可选）
    @PostMapping("/jobSeekers")
    List<JobSeeker> getJobSeekersByIds(@RequestBody List<Long> userIds);

    @PostMapping("/hrs")
    List<CompanyHr> getHrsByIds(@RequestBody List<Long> userIds);

}
